<%-- 
    Document   : generate
    Created on : 01.08.2009, 08:20:14
    Author     : Mario
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../STYLES/serverStyles.css" />
        <title>FBIS - ADMIN / BESTELLBEDARF</title>
    </head>
    <body>
        <jsp:useBean id="calc" scope="application" class="de.stalinski.util.Calculator" />
        <%
        java.util.Enumeration paramNames = request.getParameterNames();
        java.util.HashMap<String, Integer> values = new java.util.HashMap<String, Integer>();
        java.util.ArrayList<String> keys = new java.util.ArrayList<String>();
        String sort = "";
        int amount = 0;
        int weeks = 0;
        int days = Integer.parseInt(request.getParameter("days"));
        while (paramNames.hasMoreElements()) {
            sort = (String) paramNames.nextElement();
            amount = Integer.parseInt(request.getParameter(sort));
            if (!sort.equals("weeks") && !sort.equals("days")) {
                values.put(sort, amount);
                keys.add(sort);
            } else if (sort.equals("weeks")) {
                weeks = amount;
            }
        }
 
        %>
       <div id="container">
            <div id="header">
                <jsp:include page="../HTML/header.html"/>
            </div>
            <div id="leftBar">
                <form name="frm" action="" method="GET">
                    <div class="leftMenu">
                    <table>
                        <tbody>
                           
                            <tr>
                                <td><a class="button" href="consumption.jsp?consumer=Alle"><span>Zurück</span></a></td>
                            </tr>
                        </tbody>
                  
                    </table>
                    </div>
                </form>
            </div>
            <div id="content">
                <div class="scroll">
                    <%
        out.print(calc.calculateDemand(weeks, days, keys, values));
                    %>
                </div>
            </div>
            <div id="footer" >
                <jsp:include page="../HTML/footer.html"/>
            </div>
        </div>
    </body>
</html>
